package weifei.live.simulation.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.springframework.stereotype.Repository;


@Data
@EqualsAndHashCode(callSuper = true)
@TableName("trade_area")
@Repository
public class TradeArea extends Model<TradeArea>
{
    @Getter
    public enum Column
    {
        ID("id"),
        Name("name"),
        Longitude("longitude"),
        Latitude("latitude");

        final String name;
        Column(String name) {
            this.name = name;
        }
    }

    @TableId
    private Integer id;
    @NotBlank @NotNull
    private String name;
    @NotNull
    private Double longitude;
    @NotNull
    private Double latitude;


    public TradeArea() {}
    public TradeArea(int id) { this.id = id; }
}

